package com.example.xm.ui.home.fragments.activity_reward;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.example.xm.R;
import com.example.xm.bean.HomeBean.HomeRewardBean;

import butterknife.BindView;
import butterknife.ButterKnife;

public class RewardActivity extends AppCompatActivity {

    @BindView(R.id.iv_head_reward_activity)
    ImageView ivHeadRewardActivity;
    @BindView(R.id.tv_name_reward_activity)
    TextView tvNameRewardActivity;
    @BindView(R.id.tv_date_reward_artivity)
    TextView tvDateRewardArtivity;
    @BindView(R.id.tv_data_reward_activity)
    TextView tvDataRewardActivity;
    @BindView(R.id.rlv_reward_activity)
    RecyclerView rlvRewardActivity;
    @BindView(R.id.tv_dizhi_reward_activity)
    TextView tvDizhiRewardActivity;
    @BindView(R.id.tv_canjia_num_activity)
    TextView tvCanjiaNumActivity;
    @BindView(R.id.tv_sheng_num_activity)
    TextView tvShengNumActivity;
    @BindView(R.id.tv_xuanshang)
    TextView tvXuanshang;
    @BindView(R.id.tv_qian_activity)
    TextView tvQianActivity;
    @BindView(R.id.toolbar_iv_back)
    ImageView toolbarIvBack;
    @BindView(R.id.toolbar_tv_title)
    TextView toolbarTvTitle;
    @BindView(R.id.toolbar_iv_dian)
    ImageView toolbarIvDian;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reward);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {
        Intent intent = getIntent();
        HomeRewardBean.DataBean.ListBean bean = (HomeRewardBean.DataBean.ListBean) intent.getSerializableExtra("bean");
        RequestOptions requestOptions = new RequestOptions().circleCrop();
        Glide.with(this).load(bean.getHeadUrl()).apply(requestOptions).into(ivHeadRewardActivity);
        tvNameRewardActivity.setText(bean.getNickName());
        tvDateRewardArtivity.setText(bean.getCreatetime());
        tvQianActivity.setText(bean.getRewardmoney() + "铜钱");
        tvDataRewardActivity.setText(bean.getContent());
        tvCanjiaNumActivity.setText(bean.getJoinCount() + "人参加");
        tvShengNumActivity.setText(bean.getSurplusDate());
        toolbarIvBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        toolbarIvDian.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });

    }
}